/*
 * @Author: lusx 
 * @Date: 2020-04-15 10:58:01 
 * @Last Modified by: lusx
 * @Last Modified time: 2020-05-22 13:49:58
 */
import React from 'react';
import { Link } from 'react-router-dom';
import { Tools } from 'weaver-mobile';
import classnames from 'classnames';
const tabs = [
    { title: '首页', id: "0", route: '/pro/duty' },
    { title: '督办管理', id: "1", route: '/pro/newduty' },
    { title: '任务管理', id: "2", route: '/task/task' },
    { title: '统计', id: "3", route: '/quickbar/statistics' },
];
const prefixCls = 'self-tab';
export function SelfTab() {
    return (
        <React.Fragment>
            <ul className={prefixCls}>
                {tabs.length > 0 && tabs.map(tab => {
                    const tabBarActiveStyle = classnames('self-tab-bar', { 'self-tab-bar-active': tab.id === (Tools.ss.getJSONObj("gvHomeNav") || '0').toString() });
                    return <li onClick={() => Tools.ss.set("gvHomeNav", tab.id)} key={tab.id}>
                        <Link to={tab.route}>
                            <span className={tabBarActiveStyle} >{tab.title}</span>
                        </Link>
                    </li>
                })}
            </ul>
        </React.Fragment>
    )
}